Communication apparatus, methods, and non-transitory computer-readable media for determining ip addresses for use in different networks

ABSTRACT

A communication apparatus includes a processor and a memory. The processor executes computer-readable instructions stored in the memory. The instructions instruct the communication apparatus to establish a first network including the communication apparatus and a first device. The instructions instruct the communication apparatus to establish a second network including the communication apparatus and a second device. The instructions instruct the communication apparatus to determine a target IP address. Determining the target IP address includes identifying a particular IP address, which is an IP address of the communication apparatus used in the second type network. Determining the target IP address includes generating the target IP address to be within a particular range using the particular IP address. The particular range is a range of IP addresses that are not available in the second type network. The instructions instruct the communication apparatus to assign the target IP address to the first device.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Japanese Patent Application No.2012-019088, filed on Jan. 31, 2012, the disclosure of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention disclosed herein relates generally to networkcommunication and more specifically to communication apparatus, methods,and non-transitory computer-readable media for determining IP addressesfor use in different networks.

2. Description of Related Art

A known system includes a wireless access point connected to twowireless local area network (“LAN”) cards, a first notebook personalcomputer (“PC”) connected to one of the wireless LAN cards, and a secondnotebook PC connected to the other one of the wireless LAN cards. AnInternet Protocol (“IP”) address including a subnet address assigned tothe one of the wireless LAN cards is assigned to the first notebook PCfrom a Dynamic Host Configuration Protocol (“DHCP”) server on artintranet. An IP address including a subnet address assigned to the otherwireless LAN card is assigned to the second notebook PC from a DHCPserver in the wireless access point. As a result, the first notebook PCand the second notebook PC belong to different subnetworks.

SUMMARY OF THE INVENTION

Aspects of the disclosure may provide a technology that may enableproper execution of communication between a communication apparatus anda first device and communication between the communication apparatus anda second device by dynamically determining a target IP address to beassigned to the first device by the communication apparatus.

A communication apparatus disclosed herein may include a processor and amemory. The memory may be configured to store computer-readableinstructions therein. The processor may execute the computer-readableinstructions, which may instruct the communication apparatus to performvarious processes in accordance therewith. In particular, thecomputer-readable instructions may instruct the communication apparatusto establish a first type network including the communication apparatusand a first device. Further, the computer-readable instructions mayinstruct the communication apparatus to establish a second type networkincluding the communication apparatus and a second device. In addition,the computer-readable instructions may instruct the communicationapparatus to determine a target IP address for the first device inresponse to satisfaction of a first condition. The process ofdetermining the target IP address may include a process of identifying aparticular IP address. The particular IP address may be an IP address ofthe communication apparatus used in the second type network. The processof determining the target IP address may further include generating thetarget IP address to be within a particular range using the particularIP address. The particular range may be a range of IP addresses that maynot be available in the second type network. Moreover, thecomputer-readable instructions may instruct the communication apparatusto assign the target IP address to the first device.

According to particular configurations, under a particular condition,the communication apparatus may determine an IP address (e.g., a targetIP address) for a first device that is not included in a particularaddress range, which may be a range of IP addresses not available in asecond type network, by referring to an IP address (e.g., a particularIP address) for a communication apparatus used in the second typenetwork. Consequently, the communication apparatus may dynamicallydetermine the target IP address that is included in the particularaddress range in accordance with the particular IP address and mayassign the target IP address to the first device. Therefore, forexample, the communication apparatus may properly transmit data to thefirst device when the data is to be transmitted to the first deviceusing the target IP address as a destination. Accordingly, thecommunication apparatus may properly execute communication.

A control method, computer-executable instructions, and a non-transitorycomputer-readable recording medium storing the computer-executableinstructions, each of which may realize the above-disclosed functions ofthe communication apparatus also are disclosed herein.

For example, a computer-readable storage medium disclosed herein maystore computer-readable instructions therein. When executed by theprocessor of a communication apparatus, the computer-readableinstructions may instruct the communication apparatus to perform variousprocesses in accordance therewith. In particular, the computer-readableinstructions may instruct the communication apparatus to establish afirst type network including the communication apparatus and a firstdevice. Further, the computer-readable instructions may instruct thecommunication apparatus to establish a second type network including thecommunication apparatus and a second device. In addition, thecomputer-readable instructions may instruct the communication apparatusto determine a target IP address for the first device in response tosatisfaction of a first condition. The process of determining the targetIP address may include a process of identifying a particular IP address.The particular IP address may be an IP address of the communicationapparatus used in the second type network. The process of determiningthe target IP address may further include generating the target IPaddress to be within a particular range using the particular IP address.The particular range may be a range of IP addresses that may not beavailable in the second type network. Moreover, the computer-readableinstructions may instruct the communication apparatus to assign thetarget IP address to the first device.

In addition, a communication apparatus disclosed herein may includevarious devices therein. In particular, the communication apparatus mayinclude a first establishing device that may establish a first typenetwork including the communication apparatus and a first device.Further, the communication apparatus may include a second establishingdevice that may establish a second type network including thecommunication apparatus and a second device. In addition, thecommunication apparatus may include a determining device that maydetermine a target IP address for the first device in response tosatisfaction of a first condition. The determining device may include anidentifying portion that may identify a particular IP address. Theparticular IP address may be an IP address of the communicationapparatus used in the second type network. The determining device alsomay include a generating portion that may generate the target IP addressto be within a particular range using the particular IP address. Theparticular range may be a range of IP addresses that are not availablein the second type network. Moreover, the communication apparatus mayinclude an assigning device that may assign the target IP address to thefirst device.

Other objects, features, and advantages will be apparent to persons ofordinary skill in the art from the following detailed description of thedisclosure and the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present disclosure, needssatisfied thereby, and the objects, features, and advantages thereof,reference now is made to the following descriptions taken in connectionwith the accompanying drawings.

FIG. 1 is a block diagram showing particular configurations of acommunication system.

FIG. 2 is a flowchart showing a process of establishing a Wi-Fi Direct(“WFD”) network.

FIG. 3 is a flowchart showing a process of dynamically determining an IPaddress.

FIG. 4 is a flowchart showing a process of establishing a non-WFDnetwork.

FIG. 5 is a diagram that shows a sequence of processes that may occur ina Case A1.

FIG. 6 is a diagram that shows a sequence of further processes that mayoccur in the Case A1.

FIG. 7 is a diagram that shows a sequence of processes that may occur ina Case B.

FIG. 8 is a diagram that shows a sequence of further processes that mayoccur in the Case B.

FIG. 9 is a flowchart that shows a process of establishing a WFD networkaccording to some configurations of a communication system.

FIG. 10 is a diagram that shows a sequence of processes that may occurin a Case A2.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION

Particular embodiments now are disclosed. As shown in FIG. 1, acommunication system 2 may comprise an access point (“AP”) 4, a PC 6, amobile terminal 8, and a printer 10 (e.g., a peripheral device of the PC6, the mobile terminal 8, and the like). The mobile terminal 8 and theprinter 10 may each may execute a wireless communication functioncomplying with the Wi-Fi Direct™ (“WFD”) standard, which will bedescribed below (Wi-Fi Direct™ is a certification mark owned by theWi-Fi Alliance of Austin, Tex.). A connection complying with the WFDstandard may be referred to as a “WFD connection.” The printer 10 mayestablish a WFD connection to the mobile terminal 8, and, accordingly, aWFD network may be established. Thus, the mobile terminal 8 and theprinter 10 may execute wireless communication of target data, such asprint data.

In addition to the wireless communication function according to WFD, theprinter 10 may execute a normal wireless communication function (e.g.,wireless communication that complies with the 802.11 standard defined bythe Institute of Electrical and Electronics Engineers (“IEEE”)).Accordingly, the printer 10 may establish a non-WFD connection (e.g., aconnection that does not comply with the WFD standard) to the AP 4, and,accordingly, a non-WFD network may be established. The PC 6 also mayestablish a non-WFD connection to the AP 4 (e.g., a Wi-Fi connectionwith AP 4). Thus, the printer 10 and the PC 6 may execute wirelesscommunication of target data, such as print data, through the AP 4.

In particular configurations, the AP 4, the PC 6, and the printer 10 maybe, for example, disposed in a particular location. Accordingly, in theparticular location, a non-WFD network comprising the AP 4, the PC 6,and the printer 10 may be established. Therefore, an input (e.g., via aworker in the particular location) through the PC 6 may cause theprinter 10 to execute printing through the AP 4. In addition, forexample, an input (e.g., via a visitor to the particular location)through a mobile terminal 8 may temporarily establish a WFD connectionbetween the mobile terminal 8 and the printer 10. Accordingly, themobile terminal 8 may be used to temporarily establish a WFD networkcomprising the mobile terminal 8 and the printer 10. Therefore, themobile terminal 8 may be used to cause the printer 10 to executeprinting without using the AP 4. Thus, in particular configurations, thenon-WFD network may be an enduring network established for long-term useand the WFD network may be a temporary network established for temporaryuse.

The printer 10 may comprise an operation device 12, a display device 14,a printing execution device 16, a wireless interface 18, and a controldevice 20. The devices 12, 14, 16, 18, and 20 may be connected to a busline (reference numeral omitted). The operation device 12 may comprise aplurality of keys. Various instructions may be input to the printer 10by operating the operation device 12. The display device 14 may be adisplay for displaying various pieces of information. The printingexecution device 16 may comprise a printing mechanism adopting, forexample, an inkjet method, a laser method, or another method, and mayexecute printing in accordance with an instruction from the controldevice 20.

The wireless interface 18 may be an interface used by the control device20 to execute wireless communication. The wireless interface 18 may bephysically a single interface. However, both a media access control(“MAC”) address to be used for a WFD connection and a MAC address to beused for a non-WFD connection may be assigned to the wireless interface18. Therefore, the control device 20 may simultaneously execute both thewireless communication function according to WFD and the normal wirelesscommunication function using the wireless interface 18. Accordingly, thecontrol device 20 may produce a scenario in which both a WFD network anda non-WFD network have been established, which is described in detailbelow.

The control device 20 may comprise a central processing unit (“CPU”) 22and a memory 24. The CPU 22 may execute various processes in accordancewith programs stored in the memory 24. The memory 24 may comprise aread-only memory (“ROM”), a random-access memory (“RAM”), a hard disk,or other storage components. The memory 24 may store thecomputer-readable instructions to be executed by the CPU 22 and dataobtained or generated while the CPU 22 is executing processes. Byperforming various processes when executing such computer-readableinstructions, CPU 22 may function as various devices, such as devices30, 32, 34, 36, 38, 40, and 42, which are described in detail below.

The AP 4 may relay wireless communication between devices (e.g., the PC6 and the printer 10) comprised in the non-WFD network. Furthermore, theAP 4 may function as a DHCP server that may assign IP addresses to suchdevices in the non-WFD network. The AP 4 may determine an IP address forthe printer 10 to be used in the non-WFD network (“non-WFD IP addressfor the printer 10”) and may assign the non-WFD IP address for theprinter 10 to the printer 10. Similarly, the AP 4 may assign a non-WFDIP address for the PC 6 to the PC 6. Thus, the printer 10 may functionas a second establishing device 32 and may execute communication ofprint data or other data with the PC 6 using the non-WFD IP address forthe printer 10 assigned from the AP 4, the IP address for the AP 4, andthe IP address for the PC 6. Thus, in particular configurations,establishing a non-WFD network comprising the AP 4, the PC 6, and theprinter 10 may permit communication using IP addresses. In the non-WFDnetwork, IP addresses that comply with the Internet Protocol version 4(“IPv4”) standard defined by the Internet Engineering Task Force(“IETF”) may be used.

The PC 6 may establish a non-WFD connection to the AP 4. The PC 6 maycomprise a CPU, a memory, a display, and other components (not shown).The memory of the PC 6 may store a printer driver program (e.g.,computer-readable instructions for controlling a printer) for theprinter 10. The CPU of the PC 6 may generate print data to be printedusing the printer driver program. When a non-WFD connection has beenestablished between the printer and the AP 4 and a non-WFD connectionhas been established between the PC 6 and the AP 4, the PC 6 maywirelessly transmit the print data to the printer 10 through the AP 4.

The mobile terminal 8 may be a portable terminal and may be, forexample, a smartphone, a personal digital assistant (“PDA”), a notebookPC, a tablet PC, or other terminal device. The mobile terminal 8 mayexecute the wireless communication function complying with the WFDstandard. The mobile terminal 8 may establish a WFD connection to theprinter 10. The mobile terminal 8 may comprise a CPU, a memory, adisplay, and other components (not shown). The memory of the mobileterminal 8 may store a printer driver program for the printer 10. TheCPU of the mobile terminal 8 may generate print data to be printed usingthe printer driver program. When a WFD connection has been establishedbetween the printer 10 and the mobile terminal 8, the mobile terminal 8may wirelessly transmit the print data to the printer 10 without usingthe AP 4.

As noted above, WFD is a standard defined by the Wi-Fi Alliance. The WFDstandard is described in “Wi-Fi Peer-to-Peer (P2P) TechnicalSpecification Version 1.1” created by the Wi-Fi Alliance.

As disclosed above, the printer 10 and the mobile terminal 8 may eachexecute wireless communication that complies with the WFD standard. Adevice that may execute wireless communication that complies with theWFD standard is referred to as a “WFD-enabled device” hereinafter, inthe WFD standard, three states, namely a Group Owner state (“G/Ostate”), a client state, and a device state, are defined as the statesof a WFD-enabled device. The WFD-enabled device may selectively operatein one of the three states.

A device in the G/O state and a device in the client state mayconstitute a single WFD network. In a single WFD network, the number ofdevices in the G/O state is invariably one, but the number of devices inthe client state may be one or more. The device in the G/O state maycontrol the one or more devices in the client state. More specifically,the device in the G/O state may generate a control list in whichidentification information (e.g., a MAC address) regarding each of theone or more devices in the client state may be described. When a devicein the client state has newly joined the WFD network, the device in theG/O state may add identification information regarding the device to thecontrol list. When a device in the client state has left the WFDnetwork, the device in the G/O state may delete identificationinformation regarding the device from the control list.

The device in the G/O state may execute wireless communication of targetdata (e.g., data, such as print data or other data, comprisinginformation in the network layer of the Open Systems Interconnection(“OSI”) reference model created by the International Organization forStandardization (“ISO”)) with a device registered in the control list(e.g., a device in the client list). Although the device in the G/Ostate may execute wireless communication of data (e.g., data that doesnot comprise information in the network layer, such as data in thephysical layer, which may comprise, for example, a probe request signalor a probe response signal) associated with joining the WFD network witha device that has not been registered in the control list, the device inthe G/O state may not execute wireless communication of the target datawith such a device. For example, the printer 10 in the G/O state maywirelessly receive print data from the mobile terminal 8 (e.g., themobile terminal 8 in the client state) registered in the control list,but the printer 10 in the G/O state may not receive print data, from adevice that has not been registered to the control list.

In addition, the device in the G/O state may relay wirelesscommunication of target data (e.g., print data or other data) between aplurality of devices in the client state. For example, when the mobileterminal 8 in the client state is to wirelessly transmit print data toanother printer in the client state, the mobile terminal 8 maywirelessly transmit the print data to the printer 10 in the G/O state.In response to such transmission, the printer 10 may wirelessly receiveprint data from the mobile terminal 8 and may wirelessly transmit theprint data to the other printer. Accordingly, a device in the G/O statemay function as an AP in a wireless network.

Furthermore, a device in the G/O state may function as a DHCP serverthat may assign an IP address to a device in the client state. Forexample, the printer 10 in the G/O state may determine an IP address forthe printer 10 to be used in the WFD network (“WFD IP address for theprinter 10”). Further, the printer 10 in the G/O state may determine anIP address for the mobile terminal 8 in the client state (“WFD IPaddress for the mobile terminal 8”), and may assign the WFD IP addressfor the mobile terminal 8 to the mobile terminal 8. In doing so, theprinter 10 may execute communication of print data or other data withthe mobile terminal 8 using the WFD IP address for the printer 10 andthe WFD IP address for the mobile terminal 8. Thus, in particularconfigurations, establishing a WFD network comprising the mobileterminal 8 and the printer 10 may correspond to beginning communicationusing IP addresses. In the WFD network, IP addresses according to theIPv4 standard may be used.

A WFD-enabled device (e.g., a device that has not been registered to thecontrol list) that has not joined a WFD network may be a device in thedevice state. A device in the device state may execute wirelesscommunication of data (e.g., data in the physical layer, such as a proberequest signal or a probe response signal, or other data) for joiningthe WFD network, but the device in the device state may not executewireless communication of target data (e.g., print data or other data)through the WFD network.

A process of establishing a WFD network executed by the printer 10 isdescribed with reference to FIG. 2. When a predetermined instruction tobuild a WFD network is input to the operation device 12, the controldevice 20 may begin the process of establishing a WFD network shown inFIG. 2.

Although not shown in FIG. 2, when the instruction to build a WFDnetwork has been input to the printer 10, a first establishing device 30may execute a search process of searching for devices in the devicestate (e.g., the mobile terminal 8) around the printer 10. Furthermore,the first establishing device 30 may control the display device 14 todisplay a device list comprising information (e.g., the names of thedevices, the names of models, MAC addresses, or other information)regarding the devices found in the search process. An input to theprinter 10 may specify, in the device list, a device with which aconnection to the printer 10 is to be established. The firstestablishing device 30 may select the device in accordance with an inputinstruction. In the following example discussion, it may be assumed thatthe mobile terminal 8 has been selected, although other devices may beselected.

When an instruction to build a WFD network has been input to the mobileterminal 8, the mobile terminal 8 may execute the search process for theprinter 10. Therefore, a device list comprising information regardingthe printer 10 may be displayed on the display of the mobile terminal 8.A device with which a connection to the mobile terminal 8 is to beestablished may be selected from the device list on the mobile terminal8. In the following example discussion, it may be assumed that theprinter 10 has been selected, although other devices may be selected

In Step S10, the first establishing device 30 may execute G/Onegotiation to determine one of the printer 10 and the mobile terminal 8to be set to a G/O state and the other of the printer 10 and the mobileterminal 8 to be set to a client state. More specifically, a firstestablishing device 30 may transmit an intent value of the printer 10saved to the memory 24 to the mobile terminal 8. In addition, the firstestablishing device 30 may receive an intent value of the mobileterminal 8 saved to the mobile terminal 8 from the mobile terminal 8.The intent value may be a setting value indicating the suitability of adevice for the G/O state. The intent value may be, for example, a valuein a value range of 0 to 15. The greater the intent value, the greaterthe suitability for the G/O. Conversely, the less the intent value, themore likely the device is to become a client.

For example, a device (e.g., a PC), whose CPU and memory are of the highperformance type, may operate as a G/O while executing another processat a high speed. Therefore, a relatively large intent value normally maybe set for such a device, such that the device may likely be set to theG/O state. Conversely, for example, a device whose CPU and memory haverelatively low performance might not be able to operate as a G/O whileexecuting another process at high speed. Therefore, a relatively smallintent value generally may be set for such a device, such that thedevice may be unlikely to be set to the G/O state (e.g., the device maylikely be set to the client state).

In the present example configurations, a value of “2” may be set as theintent value (e.g., the default intent value) of the printer 10. The CPUand the memory of the printer 10 generally may have low performancecompared to those of a PC 6 or other devices. Therefore, a relativelysmall default intent value may be set for the printer 10. Consequently,in Step S10, the first establishing device 30 normally may transmit theintent value of “2” for the printer 10 to the mobile terminal 8.Nevertheless, when Step S34 (shown in FIG. 2) or Step S82 (shown in FIG.4) has been executed, the intent value of the printer 10 may be changedfrom 2 to 14, for example, which is described below in detail.Therefore, when Step S10 follows immediately after Step S34 or Step S82is executed, the first establishing device 30 may transmit the intentvalue of “14” for the printer 10 to the mobile terminal 8.

Furthermore, in Step S10, the first establishing device 30 may comparethe intent value of the printer 10 and the intent value of the mobileterminal 8, and may determine a device to be set to a G/O state andanother device to be set to a client state. For example, when the intentvalue of the printer 10 is greater than the intent value of the mobileterminal 8, the first establishing device 30 may determine that theprinter 10 is to be set to the G/O state and that the mobile terminal 8is to be set to the client state. On the other hand, for example, whenthe intent value of the printer 10 is less than the intent value of themobile terminal 8, the first establishing device 30 may determine thatthe mobile terminal 8 is to be set to the G/O state and that the printer10 is to be set to the client state. When the intent value of theprinter 10 and the intent value of the mobile terminal 8 are the same,the first establishing device 30 may change the intent value of theprinter 10 and may execute the G/O negotiation again using the intentvalue after the change, or the first establishing device 30 may controlthe display device 14 to display information indicating that a WFDnetwork may not be established.

In particular configurations, the mobile terminal 8 may determine a G/Odevice and a client device on the basis of the intent value of theprinter 10 and the intent value of the mobile terminal 8 using the samemethod as the printer 10. When the G/O negotiation in Step S10 has beencompleted, the process may proceed to Step S12.

In Step S12, the first establishing device 30 may execute a negotiationprocess complying with the Wi-Fi Protected Setup™ (“WPS”) standard toestablish a WFD connection to the mobile terminal 8 (Wi-Fi ProtectedSetup™ is a certification mark owned by the Wi-Fi Alliance of Austin,Tex.). When it has been determined that the printer 10 is to be the G/Odevice, the first establishing device 30 may execute WPS negotiation forthe G/O state. Conversely, when it has been determined that the printer10 is to be the client device, the first establishing device 30 mayexecute WPS negotiation for the client state.

In the WPS negotiation for the G/O state, the first establishing device30 may generate data indicating a wireless profile (e.g., a service setidentifier “SSID”), an authentication method, an encryption method, apassword, and other information) that may allow a WFD connection to beestablished. An authentication method and the encryption method may bepredetermined. The first establishing device 30 may generate a passwordin the processing in Step S12. A SSID may be generated by the firstestablishing device 30 in the processing in Step S12 or the SSID may bepredetermined. Subsequently, the first establishing device 30 maytransmit the data indicating the wireless profile to the mobile terminal8.

When the wireless profile has been transmitted from the printer 10 tothe mobile terminal 8, the printer 10 and the mobile terminal 8 may usethe same wireless profile. The first establishing device 30 may executewireless communication (hereinafter referred to as the “particularwireless communication”) comprising an ausubsequentlytication request,an ausubsequentlytication response, an association request, anassociation response, and a four-way handshake with the mobile terminal8 using the wireless profile. In the course of the particular wirelesscommunication, various authentication processes such as authenticationof the SSID, authentication of the authentication method and theencryption method, and authentication of the password may be executed.When the authentication has been completed successfully, a WFDconnection may be established between the printer 10 and the mobileterminal 8. The first establishing device 30 may add identificationinformation regarding the mobile terminal 8 (e.g., the MAC address ofthe mobile terminal 8) to the control list.

In the WPS negotiation for the client state, the first establishingdevice 30 may receive data indicating a wireless profile from the mobileterminal 8. Subsequently, the first establishing device 30 may executethe particular wireless communication with the mobile terminal 8 usingthe wireless profile. In doing so, a WFD connection may be establishedbetween the printer 10 and the mobile terminal 8. The mobile terminal 8may add identification information regarding the printer 10 (e.g., theMAC address of the printer 10) to the control list. When the WPSnegotiation in Step S12 has been completed, the process may proceed toStep S14.

In Step S14, the first establishing device 30 may judge whether anon-WFD network has been established. If a non-WFD network has beenestablished (YES in Step S14), the process may proceed to Step S24, and,if a non-WFD network has not been established (NO in Step S14), theprocess may proceed to Step S16.

In Step S16, the first establishing device 30 may judge whether thecurrent state of the printer 10 is the G/O state or the client state. Ifthe current state of the printer 10 is the G/O state (YES in Step S16),the process may proceed to Step S18, and, if the current state of theprinter 10 is the client state (NO in Step S16), the process may proceedto Step S22.

As described above, the printer 10 in the G/O state functions as a DHCPserver. Therefore, in Step S18, a determination device 34 may determinea default IP address (e.g., 192.168.1.1) that may be prepared in advanceas the WFD IP address for the printer 10. Furthermore, in Step S18, thedetermination device 34 may determine a subnet mask to be used in theWFD network (“WFD subnet mask”). The WFD subnet mask may be a defaultsubnet mask (e.g., 255.255.255.0) that may be prepared in advance.Moreover, in Step S18, the determination device 34 may determine therange of IP addresses that may be assigned by the printer 10 as the DHCPserver. The address range determined here may be a default address range(e.g., 192.168.1.2-16) that may be prepared in advance. In addition, inStep S18, the determination device 34 may determine a single IP address(e.g., 192.168.1.2) from the address range as the WFD IP address for themobile terminal 8.

Subsequently, in Step S20, the determination device 34 may notify (e.g.,may transmit) the mobile terminal 8 of the WFD IP address for the mobileterminal 8 or the WFD IP address for the printer 10 determined in StepS18 and the WFD subnet mask determined in Step S18. Accordingly, thedetermination device 34 may assign the WFD IP address for the mobileterminal 8 to the mobile terminal 8. In doing so, the first establishingdevice 30 may begin to wirelessly communicate with the mobile terminal 8using the WFD IP address for the printer 10 or the WFD IP address forthe mobile terminal 8. That is, the first establishing device 30establishes a WFD network comprising the mobile terminal 8 and theprinter 10. Consequently, the printer 10 (e.g., the first establishingdevice 30) in the G/O state may execute communication of target data(e.g., print data or other data) comprising data in the network layer,which is a layer superior to the physical layer in the OSI referencemodel, with the mobile terminal 8 in the client state. The printer 10(e.g., the first establishing device 30) in the G/O state may relaywireless communication between the mobile terminal 8 in the client stateand another device in the client state registered to the control list.When Step S20 has been completed, the process of establishing a WFDnetwork shown in FIG. 2 may end.

If a determination of NO is made in Step S16 (e.g., if the current stateof the printer is the client state), the mobile terminal 8 in the G/Ostate may function as a DHCP server. Therefore, the mobile terminal 8may determine the WFD IP address for the printer 10 and the WFD subnetmask. In Step S22, an obtaining device 36 may obtain the WFD IP addressfor the printer 10 or the WFD IP address for the mobile terminal 8 andthe WFD subnet mask from the mobile terminal 8. In doing so, the firstestablishing device 30 may begin to wirelessly communicate with themobile terminal 8 using the WFD IP address for the printer 10 or the WFDIP address for the mobile terminal 8. That is, the first establishingdevice 30 may establish a WFD network comprising the mobile terminal 8and the printer 10. When Step S22 has been completed, the process ofestablishing a WFD network shown in FIG. 2 may end.

If a determination of YES is made in Step S14 (e.g., if a non-WFDnetwork has been established), the first establishing device 30 mayjudge in Step S24 whether the current state of the printer 10 is the G/Ostate or the client state. If the current state of the printer 10 is theG/O state (YES in Step S24), the process may proceed to Step S26, and ifthe current state of the printer 10 is the client state (NO in StepS24), the process may proceed to Step S28.

In Step S26, the determination device 34 may execute a process ofdynamically determining an IP address. As shown in FIG. 3, in Step S50,the determination device 34 may judge whether or not the number ofdigits of a mask portion of a subnet mask (“non-WFD subnet mask”) thatis currently being used in the non-WFD network is equal to or greaterthan the number of digits of a mask portion of a default subnet maskused in Step S18 shown in FIG. 2. For example, if the non-WFD subnetmask is “255.255.0.0,” the number of digits of the mask portion of thenon-WFD subnet mask may be a number of digits corresponding to 16 bits(e.g., 255.255). Moreover, for example, if the default subnet mask is“255.255.255.0,” the number of digits of the mask portion of the defaultsubnet mask may be a number of digits corresponding to 24 bits (e.g.,255.255.255).

If the number of digits of the mask portion of the non-WFD subnet maskis equal to or greater than the number of digits of the mask portion ofthe default subnet mask (YES in Step S50), the determination device 34may determine the default subnet mask as a determined subnet mask inStep S52. If the number of digits of the mask portion of the non-WFDsubnet mask is less than the number of digits of the mask portion of thedefault subnet mask (NO in Step S50), the determination device 34 maydetermine the non-WFD subnet mask as a determined subnet mask in StepS54. Consequently, in Steps S50, S52, and S54, the determination device34 may determine a subnet mask, from the non-WFD subnet mask and thedefault subnet mask, that has a smaller number of digits in the maskportion to be a determined subnet mask.

When Step S52 or Step S54 has been completed, the determination device34 may calculate, in Step S56, a value masked by the determined subnetmask in the non-WFD IP address for the printer 10 that is currentlybeing used in the non-WFD network. In a first example, the non-WFD IPaddress for the printer 10 may be “192.168.1.2,” and the determinedsubnet mask determined in Step S52 may be “255.255.255.0.” In this case,in Step S56, the determination device 34 may calculate “192.168.1.” In asecond example, the non-WFD IP address for the printer 10 may be“192.168.1.2,” and the determined subnet mask determined in Step S54 maybe “255.255.0.0.” In this example, in Step S56, the determination device34 may calculate “192.168.”

Subsequently, in Step S58, the determination device 34 may determine avalue different from the value calculated in Step S56; however, thevalue may have the same number of digits as the value calculated in StepS56. In the first example, in Step S58, the determination device 34 maydetermine, for example, “192.169.1.” Although values in the ninth tosixteenth bits may be changed in this example, values in first to eighthbits may be changed (e.g., “193.168.1”) or values in seventeenth totwenty-fourth bits may be changed (e.g., “192.168.2”) instead. In thesecond example, in Step S58, the determination device 34 may determine,for example, “192.169.” Although values in ninth to sixteenth bits arechanged in this example, values in first to eighth bits may be changed(e.g., “193.168”) instead.

Subsequently, in Step S60, the determination device 34 may determine anIP address comprising the value calculated in Step S58 as the WFD IPaddress for the printer 10. In the first example, in Step S60, thedetermination device 34 may determine, for example, an IP address“192.169.1.1” comprising “192.169.” In the second example, in Step S60,the determination device 34 may determine, for example, an IP address“192.169.1.1” comprising “192.162.” In Step S60, as in Step S18 shown inFIG. 2, the determination device 34 may determine the default subnetmask (e.g., “255.255.255.0”) as the WFD subnet mask. Furthermore, inStep S60, the determination device 34 may determine the range of IPaddresses that may be assigned by the printer 10 as the DHCP server.More specifically, the determination device 34 may calculate a networkaddress (e.g., “192.169.1”) masked by the default subnet mask in the WFDIP address (e.g., “192.169.1.1”) for the printer 10. The determinationdevice 34 subsequently may determine art address range (e.g.,“192.169.1.2-16”) that may comprise the network address (e.g.,“192.169.1”) but does not comprise the WFD IP address (e.g.,“192.169.1.1”) for the printer 10. Moreover, in Step S60, thedetermination device 34 may determine a single IP address (e.g.,“192.169.1.2”) in the address range as the WFD IP address for the mobileterminal 8.

A reason why a subnet mask whose number of digits of the mask portion isused as the determined subnet mask in Step S50 to Step S54 shown in FIG.3 may be demonstrated by example. For example, in some configurationsthe non-WFD IP address for the printer 10 is “192.168.1.4” and thenon-WFD subnet mask is “255.2525555.0.” Consequently, the IP address therange of IP addresses available in the non-WFD network may be“192.168.1.1-255.” According to the disclosure above, the WFD subnetmask (e.g., the default subnet mask) may be “255.255.0.0.”

In the above example, for example, if the printer 10 executes Step S56and Step S58 using the non-WFD IP address “192.168.1.4” and the non-WFDsubnet mask “255.255.255.0,” whose number of digits of the mask portionis great, “192.168.1” may be calculated in Step S56 and “192.168.2” maybe calculated in Step S58. In this example, the printer 10 maydetermine, for example, an address range (e.g., “192.168.1-255.1-255”),which may comprise a network address “192.168” masked by the WFD subnetmask “255.255.0.0” and the calculated value “192.168.2,” as the range ofIP addresses that may be assigned by the printer 10 as the DHCP server.In this example, the range of IP addresses “192.168.1-255.1-255”available in the WFD network and the range of IP addresses“192.168.1.1-255” available in the non-WFD network may overlap.Therefore, an IP address (e.g., “192.168.1.5”) comprised in the range ofIP addresses “192.168.1.1-255” available in the non-WFD network may bedetermined as the IP address for the mobile terminal 8. Conversely, therange of IP addresses not available in the non-WFD network may be, forexample “1-191.1-168.1-255.1-255,” “193-255.1-168.1-255.1-255,”“192.1-167.1-255.1-255,” and “192.169-255.1-255.1-255.” Such IPaddresses may comprise network addresses that are not currently assignedto a device in the non-WFD network.

If the above-described event occurs, for example, the printer 10 may notproperly identify an appropriate one of the WFD network and the non-WFDnetwork to which the printer is to transmit data when the data is to betransmitted to the mobile terminal 8 using the IP address “192.168.1.5”as the destination. Consequently, data communication may not be properlyexecuted. Moreover, for example, the printer 10 may not properlyidentify an appropriate network to which the printer 10 is to transmitdata when the data is to be transmitted to the PC 6 using an IP address“192.168.1.6” as the destination. Consequently, the data may not beproperly transmitted. In order to suppress occurrence of such an event,the printer 10 according to particular configurations may execute an IPaddress assignment function (e.g., a DHCP server function) using asubnet mask whose number of digits of the mask portion is small as thedetermined subnet mask, such that the range of IP addresses available inthe non-WFD network and the range of IP addresses available in the WFDnetwork do not overlap. Therefore, the printer 10 may properly determinethe WFD IP address for the mobile terminal 8 or the WFD IP address forthe printer 10. Consequently, the printer 10 may properly transmit datato the mobile terminal 8 using the WFD network and may properly transmitdata to the PC 6 through the AP 4 using the non-WFD network.

When Step S60 has been completed, the process of dynamically determiningan IP address shown in FIG. 3 (Step S26 shown in FIG. 2) may end. Inthis case, the process may proceed to Step S20 shown in FIG. 2, and, asdisclosed above, the determination device 34 may assign the WFD IPaddress for the mobile terminal 8 to the mobile terminal 8. Therefore,the first establishing device 30 may begin to communicate with themobile terminal 8 (e.g., establishes a WFD network) using the WFD IPaddress for the printer 10 or the WFD IP address for the mobile terminal8 determined in Step S26. Because the non-WFD) network has already beenestablished, a condition in which both the WFD network and the non-WFDnetwork have been established may be formed.

If a determination of No is made in Step S24 shown in FIG. 2 (e.g., ifthe current state of the printer 10 is the client state), the mobileterminal 8 may function as a DHCP server. Therefore, the determinationdevice 34 may not execute the process of dynamically determining an IPaddress in Step S26. Consequently, in Step S28, the obtaining device 36may obtain the WFD IP address for the printer 10 or the WFD IP addressfor the mobile terminal 8 and the WFD subnet mask from the mobileterminal 8.

Subsequently, in Step S30, a first judgment device 38 may judge whetherthe WFD IP address for the printer 10 obtained in Step S28 is in therange of IP addresses available in the non-WFD network. Morespecifically, as shown in Steps S50, S52, and S54 in FIG. 3, the firstjudgment device 38 may determine a determined subnet mask (e.g.,“255.255.0.0”). Subsequently, the first judgment device 38 may calculatea value (e.g., “192.168”) of a portion masked by the determined subnetmask in the WFD IP address (e.g., “192.168.1.4”) for the printer 10obtained in Step S28. Moreover, the first judgment device 38 maycalculate a value (e.g., “192.168”) of a portion masked by thedetermined subnet mask in the non-WFD IP address (e.g., “192.168.1.2”)for the printer 10. If the two calculated values do not match, the firstjudgment device 38 may judge that the WFD IP address for the printer 10is not in the above range (NO in Step S30), and the process may proceedto Step S32. If the two calculated values match, the first judgmentdevice 38 may judge that the WFD IP address for the printer 10 is in theabove range (YES in Step S30), and the process may proceed to Step S34.

In Step S32, the first establishing device 30 may adopt the WFD IPaddress for the printer 10 obtained in Step S28 as the IP address forthe printer 10 used in the WFD network. Consequently, the firstestablishing device 30 may begin to communicate with the mobile terminal8 (e.g., establishes a WFD network) using the WFD IP address for theprinter 10 obtained in Step S28. Because the non-WFD network has alreadybeen established, a condition in which both the WFD network and thenon-WFD network have been established may be formed.

In Step S34, the first establishing device 30 may not adopt the WFD IPaddress for the printer 10 obtained in Step S28 as the IP address forthe printer 10 used in the WFD network. Furthermore, in Step S34, achange device 42 may change the intent value of the printer 10 from 2to, for example, 14. In some configurations, the change device 42 maychange the intent value of the printer 10 to a value different from 14(e.g., 13, 15, or another value) instead. Thus, it may be sufficient ifthe change device 42 increases the intent value of the printer 10 fromthe default intent value “2” (this may also be true for Step S82 shownin FIG. 4, which is described below).

By executing Step S34, “14” may be used as the intent value of theprinter 10 in a subsequent G/O negotiation (Step S10). Although notshown in FIG. 2, when the G/O negotiation is executed once after theintent value of the printer 10 is changed from 2 to 14, the changedevice 42 may reset the intent value of the printer 10 from 14 to 2.Moreover, in Step S34, the first establishing device 30 may change thestate of the printer 10 from the client state to the device state.Therefore, the WFD connection (e.g., the WFD connection established bythe WPS negotiation in Step S12) between the printer 10 and the mobileterminal 8 may be terminated. As a result, a scenario is created inwhich the non-WFD network has been established without establishing theWFD network.

In Step S34, the printer 10 may terminate the non-WFD network and mayadopt a configuration in which the WFD network has been established.Nevertheless, as disclosed above, the non-WFD network may be an enduringnetwork, and, if such a network is terminated, PC 6 may no longer directthe printer 10 to execute printing. To reduce such occurrences ofdisruption in the non-WFD network (e.g., termination), a configurationmay be adopted in Step S34 in which the non-WFD network that has alreadybeen established may be maintained, and the WFD network may not beestablished. Accordingly, in particular configurations, a configurationmay be adopted in which the non-WFD network, which may be an enduringnetwork, takes priority over the WFD network, which may be a temporarynetwork. When Step S34 has been completed, the process of establishing aWFD network shown in FIG. 2 may end.

A process of establishing a non-WFD network executed by the printer 10now is described with reference to FIG. 4. When a predeterminedinstruction to establish a non-WFD network is input to the operationdevice 12, the control device 20 may begin the process of establishing anon-WFD network as shown in FIG. 4.

Although not shown in FIG. 4, when the instruction to build a non-WFDnetwork has been input to the printer 10, a second establishing device32 may execute a scan process of searching for APs existing around theprinter 10. Subsequently, the second establishing device 32 may controlthe display device 14 to display an AP list comprising information(e.g., SSIDs or other information) regarding the APs found by the scanprocess. An input to the printer 10 may specify, in the AP list, an APwith which a connection to the printer 10 is to be established. Thesecond establishing device 32 may select the AP in accordance with aninput instruction. In some examples described below, the AP 4 may beselected.

Unlike the first establishing device 30, the second establishing device32 may not execute the G/O negotiation. In Step S70, the secondestablishing device 32 may execute communication for authentication withthe AP 4. In such communication, the second establishing device 32 maytransmit data regarding an authentication method, an encryption method,a password, or other information to the AP 4. The AP 4 may executeauthentication of the authentication method, the encryption method, thepassword, or other information, and, if the authentication issuccessful, may transmit data regarding the successful authentication tothe printer 10. Thus, a non-WFD connection may be established betweenthe printer 10 and the AP 4.

As described above, in the present embodiment, the AP 4 may function asa DHCP server. The AP 4 may determine the non-WFD IP address for theprinter 10 and the non-WFD subnet mask. In Step S72, the secondestablishing device 32 may obtain the non-WFD IP address for the printer10 or a non-WFD IP address for the AP 4 and the non-WFD subnet mask fromthe AP 4.

Subsequently, in Step S74, the second establishing device 32 may beginto wirelessly communicate with the AP 4 using the non-WFD IP address forthe printer 10 or the non-WFD IP address for the AP 4. Accordingly, thesecond establishing device 32 may establish a non-WFD network comprisingthe AP 4 and the printer 10. When the PC 6 has been connected to the AP4 using a non-WFD connection, the printer 10 may execute communicationof target data with the PC 6 through the AP 4.

Subsequently, in Step S76, the first establishing device 30 may judgewhether a WFD network has been established. If a WFD network has beenestablished (YES in Step S76), the process may proceed to Step S78, and,if a WFD network has not been established (NO in Step S76), the processof establishing a non-WFD network shown in FIG. 4 may end.

In Step S78, a second judgment device 40 may judge whether a current WFDIP address for the printer 10 used in the WFD network is in the range ofIP addresses available in the non-WFD network. The processing in StepS78 may be the same as that in Step S30 shown in FIG. 2. If the currentWFD IP address for the printer 10 is not in the above range (NO in StepS78), the process of establishing a non-WFD network shown in FIG. 4 mayend. Accordingly, the determination device 34 may not execute theprocess of dynamically determining an IP address in Step S84. If thecurrent WFD IP address for the printer 10 is in the above range (YES inStep S78), the process may proceed to Step S80.

In Step S80, the first establishing device 30 may judge whether thecurrent state of the printer 10 is the G/O state or the client state. Ifthe current state of the printer 10 is the G/O state (YES in Step S80),the process may proceed to Step S84, and, if the current state of theprinter 10 is the client state (NO in Step S80), the process may proceedto Step S82.

The processing in Step S82 may be the same as that in Step S34 shown inFIG. 2. Accordingly, the change device 42 may change the intent value ofthe printer 10 from 2 to 14, for example. The first establishing device30 may change the state of the printer 10 from the client state to thedevice state to terminate the WFD network. Consequently, a scenario iscreated in which the non-WFD network has been established withoutestablishing the WFD network. Thus, a configuration is adopted in whichthe non-WFD network, which may be an enduring network, may takepriority.

The processing in Step S84 may be the same as that in Step S26 shown inFIG. 2 (e.g., the same as the process shown in FIG. 3). Accordingly, thedetermination device 34 may determine a new WFD IP address for theprinter 10 that may not be in the range of IP addresses available in thenon-WFD network, a new range of IP addresses that may be assigned by theprinter 10 as the DHCP server, and a new WFD IP address for the mobileterminal 8 (e.g., Step S60 shown in FIG. 3).

Subsequently, in Step S86, the determination device 34 may change thecurrent WFD IP address for the printer 10 to the new WFD IP address forthe printer 10 determined in Step S84. Furthermore, the determinationdevice 34 may assign the new WFD IP address for the mobile terminal 8determined in Step S84 to the mobile terminal 8. Thus, the mobileterminal 8 may use the new WFD IP address for the mobile terminal 8instead of the current WFD IP address for the mobile terminal 8. Thefirst establishing device 30 may begin to wirelessly communicate withthe mobile terminal 8 using the new WFD IP address for the printer 10 orthe new WFD IP address for the mobile terminal 8. Consequently, thefirst establishing device 30 may reestablish the non-WFD network. As aresult, a scenario is created in which both the WFD network and thenon-WFD network have been established. When Step S86 has been completed,the process of establishing a non-WFD network shown in FIG. 4 may end.

Subsequently, various examples of the processes executed by thecomponents 4, 8, and 10 now are described with reference to Cases A1 andB shown in FIGS. 5 to 8. Process sequences shown in FIGS. 5 to 8 may beperformed by the printer 10 by executing the processes in accordancewith the flowcharts shown in FIGS. 2 to 4. In the following examplecases, the printer 10 may adopt “255.255.255.0” as the default WFDsubnet mask.

In Case A1, a non-WFD network may be established, and a WFD networksubsequently may be established. When an instruction to build a non-WFDnetwork has been input to the printer 10, the printer 10 may execute thecommunication for authentication with the AP 4 (Step S70 shown in FIG.4). Subsequently, the printer 10 may obtain a non-WFD IP address“192.168.1.2” for the printer 10 and a non-WFD subnet mask “255.255.0.0”from the AP 4 (Step S72). Consequently, a non-WFD network is established(Step S74).

Subsequently, when an instruction to establish a WFD network has beeninput to the printer 10, the printer 10 may execute the G/O negotiationand the WPS negotiation with the mobile terminal 8 (Steps S10 and S12shown in FIG. 2). The printer 10 may judge that the result of Step S14is YES, and, if the current state of the printer 10 is the G/O state,the printer 10 may judge that the result of Step S24 is YES.

Subsequently, the printer 10 may determine a WFD IP address“192.169.1.1” for the printer 10 and a WFD IP address “192.169.1.2” forthe mobile terminal 8 by referring to the non-WFD IP address“192.168.1.2” for the printer 10 (Step S26). Subsequently, the printer10 may notify the mobile terminal 8 of the WFD IP address “192.169.1.2”for the mobile terminal 8 and the WFD subnet mask “255.225.255.0” (StepS20). Consequently, a WFD network is established (Step S20).

In the above-described scenario, the range of IP addresses“192.168.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.169.1.1-255” available in the WFD network may notoverlap. Therefore, the printer 10 may properly determine the IPaddresses for the mobile terminal 8 and the printer 10 that are notcomprised in the range of IP addresses available in the non-WFD network.Therefore, under a condition in which both the non-WFD network and theWFD network have been established, the printer 10 may properly executecommunication using these networks.

If the current state of the printer 10 is the client state, the printer10 may judge that the result of Step S24 is NO. Consequently, theprinter 10 may obtain the WFD IP address for the printer 10 and the WFDsubnet mask “255.255.255.0” from the mobile terminal 8 (Step S28). Forexample, if the non-WFD IP address for the printer 10 is “192.169.1.4,”the printer 10 may judge the result of Step S30 is NO and may establisha WFD network using the WFD IP address “192.169.1.4” for the printer 10(Step S32). In this scenario, the range of IP addresses“192.168.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.169.1.1-255” available in the WFD network also may notoverlap. Therefore, the printer may properly execute communication usingthese networks.

If the WFD IP address for the printer 10 obtained from the mobileterminal 8 is “192.168.1.4,” the printer 10 may judge that the result ofStep S30 is YES as shown in FIG. 6. In this case, the printer 10 changesthe intent value of the printer 10 from 2 to 14 (Step S34), for example,and changes the state of the printer 10 from the client state to thedevice state (Step S34). Consequently, the printer 10 does not build aWFD network.

Subsequently, when an instruction to build a WFD network has been inputto the printer 10 again, the printer 10 may execute the G/O negotiationand the WPS negotiation with the mobile terminal 8 (Step S10 and StepS12 shown in FIG. 2). In the G/O negotiation here, the printer 10 maynormally be determined as the G/O because “14,” for example, is used asthe intent value of the printer 10. Therefore, the printer 10 may judgethat the result of Step S14 is YES and subsequently may judge that theresult of Step S24 is YES. The processing thereafter may be the same asthat at a time when the result of Step S24 is YES as shown in FIG. 5. Inthis scenario, because the intent value of the printer 10 has beenchanged from 2 to 14, for example, the printer 10 may likely bedetermined as the G/O. Therefore, the printer 10 may properly determinethe IP addresses for the mobile terminal 8 and the printer 10 that arenot in the range of IP addresses available in the non-WFD network.Accordingly, the printer 10 may properly execute communication usingthese networks.

In Case B, a WFD network may be established, and, subsequently, anon-WFD network may be established. When an instruction to build a WFDnetwork has been input to the printer 10, the printer 10 may execute theG/O negotiation and the WPS negotiation with the mobile terminal 8 (StepS10 and Step S12 shown in FIG. 2). Subsequently, the printer 10 mayjudge that the result of Step S14 is NO, and, if the current state ofthe printer 10 is the G/O state, the printer 10 may judge that theresult of Step S16 is YES.

At this time, since the non-WFD network may not yet have beenestablished, a non-WFD IP address may not yet be assigned to the printer10. Therefore, the printer 10 may determine a WFD IP address“192.168.1.1” for the printer 10 and a WFD IP address “192.168.1.2” forthe mobile terminal 8 without referring to the non-WFD IP address forthe printer 10 (Step S18). Subsequently, the printer 10 may notify themobile terminal 8 of the WFD IP address “192.168.1.2” for the mobileterminal 8 and a WFD subnet mask “255.255.255.0” (Step S20).Consequently, a WFD network may be established (Step S20).

Subsequently, when an instruction to build a non-WFD network has beeninput to the printer 10, the printer 10 may execute the communicationfor authentication with the AP 4 (Step S70 shown in FIG. 4).Subsequently, the printer 10 may obtain the non-WFD IP address for theprinter 10 and a non-WFD subnet mask “255.255.0.0” from the AP 4 (StepS72). Consequently, a non-WFD network may be established (Step S74). Ifthe non-WFD IP address for the printer is “192.169.1.4,” the printer 10may judge that the result of Step S78 is NO and may continue to use theWFD IP address “192.168.1.1,” such that the WFD network may remainestablished. In this scenario, the range of IP addresses“192.169.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.168.1.1-255” available in the WFD network may notoverlap. Therefore, the printer 10 may properly execute communicationusing these networks.

If the non-WFD IP address for the printer 10 obtained from the AP 4 is“192.168.1.4,” for example, the printer 10 may judge that the result ofStep S78 is YES and subsequently may judge that the result of Step S80is YES. In this scenario, the printer 10 may determine a new WFD IPaddress “192.169.1.1” for the printer 10 and a new WFD IP address“192.169.1.2” for the mobile terminal 8 by referring to the non-WFD IPaddress “192.168.1.4” for the printer 10 (Step S84). Subsequently, theprinter 10 may notify the mobile terminal 8 of the new WFD IP address“192.169.1.2” for the mobile terminal 8 and the WFD subnet mask“255.255.255.0” (Step S86). As a result, the WFD network may bereestablished (Step S86). Moreover, the range of IP addresses“192.168.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.169.1.1-255” available in the WFD network may notoverlap. Therefore, the printer 10 may properly determine the IPaddresses for the mobile terminal 8 and the printer 10 that are not inthe range of IP addresses available in the non-WFD network. Accordingly,the printer 10 may properly execute communication using these networks.

If the current state of the printer 10 is the client state, the printer10 may judge that the result of Step S16 is NO as shown in FIG. 8. Inthis scenario, the printer 10 may obtain a WFD IP address “192.168.1.3”for the printer 10 and the WFD subnet mask “255.255.255.0” from themobile terminal 8 (Step S22). Consequently, a WFD network may beestablished (Step S22).

Subsequently, when an instruction to build a non-WFD network has beeninput to the printer 10, the printer 10 may execute the communicationfor authentication with the AP 4 (Step S70 shown in FIG. 4).Subsequently, the printer 10 may obtain the non-WFD IP address for theprinter 10 and the non-WFD subnet mask “255.255.0.0” from the AP 4 (StepS72). Consequently, a non-WFD network may be established (Step S74). Forexample, if the non-WFD IP address for the printer 10 obtained from theAP 4 is “192.169.1.4,” the printer 10 may judge that the result of StepS78 is NO and may continue to use the WFD IP address “192.168.1.3” forthe printer 10 to keep the condition in which the WFD network has beenestablished. In this scenario, the range of IP addresses“192.169.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.168.1.1-255” available in the WFD network may notoverlap. Therefore, the printer 10 may properly execute communicationusing the WFD and non-WFD networks.

If, for example, the non-WFD IP address for the printer 10 obtained fromthe AP 4 is “192.168.1.4,” the printer 10 may judge that the result ofStep S78 is YES. In this scenario, the printer 10 may change the intentvalue of the printer 10 from 2 to 14 (Step S82), for example, and maychange the state of the printer 10 from the client state to the devicestate (Step S82). Accordingly, the printer 10 may terminate the WFDnetwork.

Subsequently, when an instruction to build a WFD network has been inputto the printer 10 again, the printer 10 may execute the G/O negotiationand the WPS negotiation with the mobile terminal 8 (Step S10 and StepS12 shown in FIG. 2). In the G/O negotiation, the printer 10 maynormally be determined as the G/O. This is because “14,” for example, isused as the intent value of the printer 10. Therefore, the printer 10may judge that the result of Step S14 is YES and subsequently may judgethat the result of Step S24 is YES. The processing thereafter may be thesame as that at a time when the result of Step S24 is YES shown in FIG.5 or 6. In this scenario, the range of IP addresses“192.168.1-255.1-255” available in the non-WFD network and the range ofIP addresses “192.169.1.1-255” available in the WFD network may notoverlap. Therefore, the printer 10 may properly determine the IPaddresses for the mobile terminal 8 and the printer 10 that are not inthe range of IP addresses available in the non-WFD network. Accordingly,the printer 10 may properly execute communication using these networks.

According to the present embodiment, as shown in Case A1 shown in FIG.5, the printer 10 may determine the WFD IP address “192.169.1.2” for theprinter 10 by referring to the non-WFD IP address “192.168.1.2” for themobile terminal 8 when a non-WFD network has been established and a WFDnetwork is to be established. In addition, as shown in Case B shown inFIG. 7, the printer 10 may determine the WFD IP address “192.169.1.2”for the mobile terminal 8 by referring to the non-WFD IP address“192.168.1.4” for the printer 10 when a WFD network has been establishedand a non-WFD network is to be established. In either case, the printer10 may properly determine the WFD IP address for the mobile terminal 8that is not in the range of IP addresses available in the non-WFDnetwork. Accordingly, the printer 10 may properly execute the IP addressassignment function such that the range of IP addresses available in thenon-WFD network and the range of IP addresses available in the WFDnetwork do not overlap. Therefore, when both the WFD network and thenon-WFD network have been established, the printer 10 may properlytransmit data to the mobile terminal 8 using the WFD network and,furthermore, may properly transmit data to the PC 6 through the AP 4using the non-WFD network.

Certain configurations now are described with respect to FIGS. 9 and 10.The certain configurations of FIGS. 9 and 10 may comprise differencesfrom configurations of FIGS. 1-8. In certain configurations, a processof establishing a WFD network shown in FIG. 9 may be executed instead ofthe process of establishing a WFD network shown in FIG. 2. In Step S100,the first establishing device 30 may judge whether a non-WFD network hasbeen established. If a non-WFD network has been established (YES in StepS100), the process may proceed to Step S114, and, if a non-WFD networkhas not been established (NO in Step S100), the process may proceed toStep S102. Steps S102, S104, S106, S108, S110, and Step S112 may be thesame as Steps S10, S12, S16, S18, S20, and S22 shown in FIG. 2.

In Step S114, the first establishing device 30 may set the printer 10 toan autonomous G/O mode. The autonomous G/O mode may be a mode in whichthe printer 10 may keep operating in the G/O state. Therefore, althougha WFD connection may not be established at the time of Step S114, theprinter 10 may be set to the G/O state. At this time, identificationinformation regarding devices in the client state may not be describedin the control list managed by the printer 10.

When the printer 10 has been set to the autonomous G/O mode in StepS114, the printer 10 may not execute the G/O negotiation. As disclosedabove, when an instruction to establish a WFD connection has been inputto the mobile terminal 8, the mobile terminal 8 may execute the searchprocess of searching for devices in the client state existing around themobile terminal 8. In certain configurations, the mobile terminal 8 alsomay execute the scan process of searching for a device in the G/O state(e.g., the printer 10) existing around the mobile terminal 8. Thus, thedevice list comprising information regarding the printer 10 may bedisplayed on the display of the mobile terminal 8. When the user of themobile terminal 8 has selected the printer in the G/O state from thedevice list, the mobile terminal 8 may determine the mobile terminal 8as the client without executing the G/O negotiation.

Subsequently, in Step S116, the first establishing device 30 may executethe WPS negotiation for the G/O state. Thus, a WFD connection may beestablished between the printer 10 and the mobile terminal 8.Subsequently, in Step S118, the determination device 34 may execute theprocess of dynamically determining an IP address. Step S118 may be thesame as the process shown in FIG. 3. When Step S118 has been completed,the process may proceed to Step S110.

In certain configurations, Case A2 shown in FIG. 10 may occur instead ofCase A1 shown in FIGS. 5 and 6. The processing executed until a non-WFDnetwork is established may be the same as that in Case A1 shown in FIG.5. Subsequently, when an instruction to build a WFD network has beeninput to the printer 10, the printer 10 may set the printer 10 to theautonomous G/O mode (Step S114 shown in FIG. 9) and may execute the WPSnegotiation for the G/O state (Step S116). The processing thereafter maybe the same as that at a time when the result of Step S24 is YES shownin FIG. 5.

In Case A2 shown in FIG. 10, the printer 10 may set the printer 10 tothe autonomous G/O mode when a non-WFD network has been established anda WFD network is to be established. Therefore, unlike Case A1 shown inFIG. 5, a condition (NO in Step S24 shown in FIG. 2) in which theprinter 10 operates in the client state may not occur. Therefore, theprinter may certainly execute the process of dynamically determining anIP address (Step S116 shown in FIG. 10. Consequently, the printer 10 mayproperly determine the WFD IP address for the mobile terminal 8 that isnot in the range of IP addresses available in the non-WFD network.

Although the specific examples of the present invention have beendescribed in detail above, these are merely examples, and the scope ofthe clams is not limited thereby. The technology described in the claimsmay comprise various modifications and alterations of the above specificexamples. Modifications of the above embodiments are listed hereinafter.

A “communication apparatus” may not be limited to the printer 10, andanother apparatus (e.g., a mobile terminal, a PC, a server, a faxmachine, a copying machine, a scanner, a multifunction device, oranother device) that may execute communication may be used instead. Inaddition, a “first device” and a “second device” may not be limited tothe mobile terminal 8 and the AP 4, respectively, and another device(e.g., a PC, a server, a printer, a fax machine, a copying machine, ascanner, a multifunction device, or another device) that may executecommunication may be used instead.

In above-described configurations, the first establishing device 30 mayestablish a WFD network and the second establishing device 32 mayestablish a non-WFD network, which may be an infrastructure comprisingthe AP 4. For example, the first establishing device 30 may establish anad hoc non-WFD network instead of the WFD network, and the secondestablishing device 32 may establish a non-WFD network as aninfrastructure instead. In such configurations, the first establishingdevice 30 may dynamically determine the IP address for the mobileterminal 8 used in the ad hoc non-WFD network by referring to the IPaddress for the printer 10 used in the non-WFD network as aninfrastructure. Alternatively, for example, the first establishingdevice 30 may establish a WFD network, and the second establishingdevice 32 may build an ad hoc non-WFD network instead of the non-WFDnetwork as an infrastructure. Alternatively, for example, the firstestablishing device 30 may build a WFD network, and the secondestablishing device 32 may build a wired network instead of the non-WFDnetwork, which may be a wireless network.

The determination device 34 may execute the following process ofdynamically determining an IP address instead of the process ofdynamically determining an IP address shown in FIG. 3. For example, thedetermination device 34 may adopt “255.255.0.0,” which may bepredetermined, as a determined subnet mask. Accordingly, thedetermination device 34 may determine the WFD IP address for the mobileterminal 8 by referring to the predetermined subnet mask “255.255.0.0,”rather than the non-WFD subnet mask and the WFD subnet mask. In ageneral network, a subnet mask (e.g., “255.0.00”) whose number of digitsof the mask portion is less than the number of digits of the maskportion of “255.255.0.0” normally may not be used. Therefore, byadopting “255.255.0.0” as the determined subnet mask, the determinationdevice 34 may properly determine the WFD IP address for the mobileterminal 8 that is not in the range of IP addresses available in thenon-WFD network. Alternatively, for example, the determination device 34may invariably adopt the non-WFD subnet mask as the determined subnetmask. Accordingly, the determination device 34 may determine the WFD IPaddress for the mobile terminal 8 by referring to the non-WFD subnetmask, rather than the WFD subnet mask (e.g., the default subnet mask).casein such a configuration, the determination device 34 may adopt thesame value as the non-WFD subnet mask as the WFD subnet mask instead ofthe default subnet mask. Consequently, the determination device 34 mayproperly determine the WFD IP address for the mobile terminal 8 that isnot in the range of IP addresses available in the non-WFD network. Ingeneral, a determination device may determine a target IP address byreferring at least to a particular IP address.

In above-described configurations, the AP 4 may function as a DHCPserver and may determine the non-WFD IP address for the printer 10.Instead of this, a non-WFD network comprising a particular DHCP serverdifferent from the AP 4 may be established. For example, the particularDHCP server may determine the non-WFD IP address for the printer 10.

The “master station state” may not be limited to the G/O state in WFD.Accordingly, it may be sufficient if a state is established in which acertain device controls other devices comprised in a wireless network(e.g., the certain device manages a list of information regarding theother devices, relays wireless communication between the other devices,or performs other actions). In addition, the “slave station state” maynot be limited to the client state in WFD. Accordingly, it may besufficient if a state is established in which a certain device iscontrolled by a device in the master station state. Therefore, the“first type network” may be a WFD network or a wireless network ofanother type, instead of the WFD network; and the “second type network”may be a network of yet another type.

In above-described configurations, the change device 42 may change theintent value of the printer 10 from 2 to 14, for example, in Step S34shown in FIG. 2 and Step S82 shown in FIG. 4. Instead of this, the firstestablishing device 30 may set the printer 10 to the autonomous G/O modein Step S34 shown in FIG. 2 and Step S82 shown in FIG. 4. In suchconfigurations, when arm instruction to build a WFD network has beeninput to the printer 10 again, the printer 10 may operate in the G/Ostate, and, therefore, the printer 10 may properly determine the WFD IPaddress for the mobile terminal 8. Alternatively, the first establishingdevice 30 may not change the intent value (furthermore, need not executethe setting of the autonomous G/O mode) in Step S34 shown in FIG. 2 andStep S82 shown in FIG. 4, but, instead, may generate a notification thata WFD network may not be established (e.g., the display device 14 mayindicate an error). In such configurations, a user of the printer 10 mayobserve the notification and learn that a WFD network may not beestablished. Accordingly measures may be taken to establish a WEDnetwork. For example, the printer 10 may be set to the autonomous G/Omode by operating (e.g., by manual operation by a user) the operationdevice 12 of the printer 10.

In configurations described above, in Step S114 shown in FIG. 9, thefirst establishing device 30 may receive the intent value of the mobileterminal 8 and may use an intent value greater than the intent value ofthe mobile terminal 8 as the intent value of the printer beforetransmitting the intent value of the printer 10 to the mobile terminal8, instead of setting the printer 10 to the autonomous G/O mode. In someconfigurations, when the printer 10 operates in the G/O state, theprinter 10 may properly determine the WFD IP address for the mobileterminal 8.

In addition, in Step S114 shown in FIG. 9, the first establishing device30 may change the intent value of the printer 10 from the default intentvalue (e.g., “2”) to a greater value (e.g., “14”) instead of setting theprinter 10 to the autonomous G/O mode. In such configurations, becausethe printer 10 is likely to operate in the G/O state, the printer 10 mayproperly determine the WFD IP address for the mobile terminal 8.

In the above-described configurations, the first establishing device 30may determine that the printer 10 is to be set to the G/O state when theintent value of the printer 10 is greater than the intent value of themobile terminal 8 in the G/O negotiation (e.g., Step S10 shown in FIG.2). Alternatively, the first establishing device 30 may determine thatthe printer 10 is to be set to the G/O state when the intent value ofthe printer 10 is less than the intent value of the mobile terminal 8.Although the “second setting value” may be greater than the “firstsetting value” in above-described configurations, the “second settingvalue” may be less than the “first setting value” when determining theG/O state in some configurations.

In above-described configurations, IP addresses according to IPv4 may beused. Alternatively, IP addresses that comply with the Internet Protocolversion 6 (“IPv6”) standard defined by IETF may be used. Accordingly,the determination device 34 may execute a process of determining anaddress, in which an IPv6 address that is not in the range of IPv6addresses available in a second type network (e.g., a non-WFD network)may be determined by referring to an IPv6 address of a communicationapparatus (e.g., the printer 10) used in the second type network, andthe determined IPv6 address may be assigned to a first device (e.g., themobile terminal 8).

In above-described configurations, the CPU 22 of the printer 10 mayfunction as the components 30, 32, 34, 36, 38, 40, and 42 when executingprocesses in accordance with computer-readable instructions.Alternatively, at least some of the components 30, 32, 34, 36, 38, 40,and 42 may be realized by hardware, such as a logic circuit or anapplication specific integrated circuit.

While the invention has been described in connection with variousexemplary structures and illustrative embodiments, it will be understoodby those skilled in the art that other variations and modifications ofthe structures, configurations, and embodiments disclosed above may bemade without departing from the scope of the invention. For example,this application comprises possible combinations of the various elementsand features disclosed herein, and the particular elements and featurespresented in the claims and disclosed above may be combined with eachother in other ways within the scope of the application, such that theapplication should be recognized as also directed to other embodimentscomprising other possible combinations. Other structures,configurations, and embodiments consistent with the scope of the claimedinvention will be apparent to those skilled in the art from aconsideration of the specification or practice of the inventiondisclosed herein. It is intended that the specification and thedescribed examples are illustrative with the true scope of the inventionbeing defined by the following claims.

What is claimed is:
 1. A communication apparatus comprising: aprocessor; and a memory storing computer-readable instructions therein,the computer-readable instructions, when executed by the processor,instructing the communication apparatus to: establish a first typenetwork comprising the communication apparatus and a first device;establish a second type network comprising the communication apparatusand a second device; determine a target IP address for the first devicein response to satisfaction of a first condition, wherein determiningthe target IP address comprises: identifying a particular IP address,the particular IP address being an IP address of the communicationapparatus used in the second type network; and generating the target IPaddress to be within a particular range using the particular IP address,the particular range being a range of IP addresses that are notavailable in the second type network; and assign the target IP addressto the first device.
 2. The communication apparatus according to claim1, wherein the range of IP addresses that are not available in thesecond type network comprises network addresses that are not currentlyassigned to any device in the second type network.
 3. The communicationapparatus according to claim 1, wherein the computer-readableinstructions, when executed by the processor, further instruct thecommunication apparatus to: determine a first IP address for thecommunication apparatus for use in the first type network, whereindetermining the first IP address comprises: identifying the particularIP address; and generating the first IP address to be within theparticular range using the particular IP address; and assign the firstIP address to the communication apparatus.
 4. The communicationapparatus according to claim 1, wherein the particular IP address is anIP address determined by a particular device that is a device other thanthe communication apparatus.
 5. The communication apparatus according toclaim 1, wherein the first condition is satisfied when at least one ofthe following occurs: the first type network is established after thesecond type network is established; and the second type network isestablished after the first type network is established.
 6. Thecommunication apparatus according to claim 1, comprising: a wirelessinterface, wherein the computer-readable instructions, when executed bythe processor, further instruct the communication apparatus to: selectone of a plurality of states as an operational state of thecommunication apparatus, the plurality of states comprising a masterstation state and a slave station state; operate as a master station ofa wireless network in response to selecting the master station state asthe operational state of the communication apparatus; operate as a slavestation of the wireless network in response to selecting the slavestation state as the operational state of the communication apparatus,and wherein the first condition is satisfied when the master stationstate is selected as the operational state of the communicationapparatus.
 7. The communication apparatus according to claim 6, whereinthe first condition is not satisfied when the slave station state isselected as the operational state of the communication apparatus, suchthat the target IP address is not determined.
 8. The communicationapparatus according to claim 6, wherein the computer-readableinstructions, when executed by the processor, further instruct thecommunication apparatus to: obtain a first IP address from the firstdevice when the slave station state is selected as the operational stateof the communication apparatus, wherein establishing the first typenetwork further comprises: assigning the first IP address as the IPaddress of the communication apparatus for use in the first type networkin response to satisfaction of a second condition, and wherein thesecond condition is satisfied when the first IP address is in theparticular range and the slave station state is selected as theoperational state of the communication apparatus.
 9. The communicationapparatus according to claim 8, wherein the second condition is notsatisfied when the first IP address is not in the particular range andthe slave station state is selected as the operational state of thecommunication apparatus, such that the first IP address is notdetermined to be the IP address of the communication apparatus for usein the first type network.
 10. The communication apparatus according toclaim 6, wherein the computer-readable instructions, when executed bythe processor, further instruct the communication apparatus to: obtain afirst IP address from the first device when the slave station state iscurrently selected as the operation state of the communicationapparatus; change a first setting value stored in the communicationapparatus from an original setting value to a new setting value that isgreater than the original setting value in response to obtaining thefirst IP address if the first IP address is not in the particular range,and wherein selecting one of the plurality of states as the operationalstate of the communication apparatus comprises: selecting the masterstation state as the operational state of the communication apparatus ifthe first setting value is greater than a second setting value stored inthe first device; and selecting the slave station state as theoperational state of the communication apparatus if the first settingvalue is less than the second setting value.
 11. The communicationapparatus according to claim 6, wherein the computer-readableinstructions, when executed by the processor, further instruct thecommunication apparatus to: obtain a first IP address from the firstdevice when the slave station state is currently selected as theoperation state of the communication apparatus; change a first settingvalue stored in the communication apparatus from an original settingvalue to a new setting value that is less than the original settingvalue in response to obtaining the first IP address if the first IPaddress is not in the particular range, and wherein selecting one of theplurality of states as the operational state of the communicationapparatus comprises: selecting the master station state as theoperational state of the communication apparatus if the first settingvalue is less than a second setting value stored in the first device;and selecting the slave station state as the operational state of thecommunication apparatus if the first setting value is greater than thesecond setting value.
 12. The communication apparatus according to claim1, further comprising: a wireless interface, wherein thecomputer-readable instructions, when executed by the processor, furtherinstruct the communication apparatus to: select one of a plurality ofstates as an operational state of the communication apparatus inresponse to satisfaction of a second condition, the plurality of statescomprising a master station state and a slave station state, wherein thesecond condition is satisfied if the first type network is establishedafter the second type network is established, and wherein the secondcondition is satisfied if the second type network is established afterthe first type network is established; operate as a master station of awireless network in response to selecting the master station state asthe operational state of the communication apparatus; operate as a slavestation of the wireless network in response to selecting the slavestation state as the operational state of the communication apparatus,wherein the first condition is satisfied when both the second conditionis satisfied and the master station state is selected as the operationalstate of the communication apparatus, and wherein the first condition isnot satisfied when the slave station state is selected as theoperational state of the communication apparatus.
 13. The communicationapparatus according to claim 1, comprising: a wireless interface,wherein the computer-readable instructions, when executed by theprocessor, further instruct the communication apparatus to: select oneof a plurality of states as an operational state of the communicationapparatus, the plurality of states comprising a master station state anda slave station state; operate as a master station of a wireless networkin response to selecting the master station state as the operationalstate of the communication apparatus; operate as a slave station of thewireless network in response to selecting the slave station state as theoperational state of the communication apparatus, and whereinestablishing the first type network further comprises: setting thecommunication apparatus to be in the master station state in response tosatisfaction of a second condition, the second condition being satisfiedwhen both the first type network and the second type network areestablished, and wherein determining the target IP address occurs aftersetting the communication apparatus to be in the master station state.14. The communication apparatus according to claim 1, wherein assigningthe target IP address to the first device further comprises: assigningthe target IP address to the first device in response to satisfaction ofa second condition, the second condition being satisfied when both thefirst type network and the second type network are established, andwherein the first device is configured to use the target IP addressinstead of a first IP address, the first IP address being an IP addressthat the first device uses currently in the first type network.
 15. Thecommunication apparatus according to claim 14, wherein thecomputer-readable instructions, when executed by the processor, furtherinstruct the communication apparatus to: determine whether a second IPaddress that the communication apparatus uses currently in the firsttype network is within the particular range in response to satisfactionof the second condition, and wherein the first condition is satisfiedwhen the second IP address is not within the particular range and boththe first type network and the second type network are established. 16.The communication apparatus according to claim 15, wherein the firstcondition is not satisfied when the second IP address is within theparticular range, such that the target IP address is not determined. 17.The communication apparatus according to claim 14, comprising: awireless interface, wherein the computer-readable instructions, whenexecuted by the processor, further instruct the communication apparatusto: determine whether a second IP address that the communicationapparatus uses currently in the first type network is within theparticular range in response to satisfaction of the second condition,change the first setting value stored in the communication apparatusfrom an original setting value to a new setting value that is greaterthan the original setting value when the slave station state iscurrently selected as the operational state of the communicationapparatus and the second IP address is not within the particular range;select a master station state as an operational state of thecommunication apparatus if the first setting value is greater than asecond setting value stored in the first device; and select a slavestation state as the operational state of the communication apparatus ifthe first setting value is less than the second setting value.
 18. Thecommunication apparatus according to claim 17, wherein the firstcondition is satisfied when the second IP address is not within theparticular range, both the first type network and the second typenetwork are established, and the master station state is currentlyselected as the operational state of the communication apparatus
 19. Thecommunication apparatus according to claim 1, wherein determining thetarget IP address further comprises: identifying a first subnet maskassociated with the first type network, the first subnet mask comprisinga first value having a first number of digits; identifying a secondsubnet mask associated with a second type network, the second subnetmask comprising a second value having a second number of digits;determining whether the second number of digits is greater than or equalto the first number of digits; generating a third subnet mask comprisinga third value, wherein the third value is equal to the first value ifthe second number of digits is greater than or equal to the first numberof digits, and wherein the third value is equal to the second value ifthe second number of digits is less than the first number of digits;calculating a masked value for the communication apparatus in the secondtype network using the third subnet mask and the particular IP address;generating a value for the target IP address using the masked value, thevalue for the target IP address being different from the masked value.20. A non-transitory computer-readable medium configured to storecomputer-readable instructions therein, the computer-readableinstructions, when executed by a processor of a communication apparatus,instructing the communication apparatus to: establish a first typenetwork comprising the communication apparatus and a first device;establish a second type network comprising the communication apparatusand a second device; determine a target IP address for the first devicein response to satisfaction of a first condition, wherein determiningthe target IP address comprises: identifying a particular IP address,the particular IP address being an IP address of the communicationapparatus used in the second type network; and generating the target IPaddress to be within a particular range using the particular IP address,the particular range being a range of IP addresses that are notavailable in the second type network; and assign the target IP addressto the first device.
 21. A communication apparatus comprising: a firstestablishing device configured to establish a first type networkcomprising the communication apparatus and a first device; a secondestablishing device configured to establish a second type networkcomprising the communication apparatus and a second device; adetermining device configured to determine a target IP address for thefirst device in response to satisfaction of a first condition, whereindetermining device comprises: an identifying portion configured toidentify a particular IP address, the particular IP address being an IPaddress of the communication apparatus used in the second type network;and a generating portion configured to generate the target IP address tobe within a particular range using the particular IP address, theparticular range being a range of IP addresses that are not available inthe second type network; and an assigning device configured to assignthe target IP address to the first device.